
import axios from 'axios';

/**
 * 收藏
 */
export class CollectService {
    // 分页查询列表
    static findCollects (queryParams) {
        return axios({
            url: '/mall/good/Collect/findCollects',
            method: 'POST',
            data: queryParams
        });
    }

    //根据ID查询指定的收藏
    static findCollect (collectId) {
        const query = {
            collectId
        }
        return axios({
            url: '/mall/good/Collect/findCollect',
            method: 'POST',
            params: query,
        });
    }

    //根据ID查询指定的收藏(包含外键名称)
    static findCollectForView (collectId) {
        const query = {
            collectId
        }
        return axios({
            url: '/mall/good/Collect/findCollectForView',
            method: 'POST',
            params: query,
        });
    }

    //根据ID查询指定的收藏(包含外键名称)
    static findCollectForEdit (collectId) {
        const query = {
            collectId
        }
        return axios({
            url: '/mall/good/Collect/findCollectForEdit',
            method: 'POST',
            params: query,
        });
    }

    //根据ID查询指定的收藏(只提取ID 和 Name)
    static findCollectsWithIdNameById (collectId) {
        const query = {
            collectId
        }
        return axios({
            url: '/mall/good/Collect/findCollectsWithIdNameById',
            method: 'POST',
            params: query,
        });
    }

    //根据名称查询收藏集合(只提取ID 和 Name)
    static findCollectsWithIdNameByName (collectName) {
        const query = {
            collectName
        }
        return axios({
            url: '/mall/good/Collect/findCollectsWithIdNameByName',
            method: 'POST',
            params: query,
        });
    }

    //新增保存收藏
    static saveCollect (collect) {
        const query = {}
        return axios({
            url: '/mall/good/Collect/saveCollect',
            method: 'POST',
            params: query,
            data: collect
        });
    }

    //修改保存收藏
    static updateCollect (collect) {
        const query = {}
        return axios({
            url: '/mall/good/Collect/updateCollect',
            method: 'POST',
            params: query,
            data: collect
        });
    }

    //根据ID查询指定的收藏(只提取ID 和 Name)
    static deleteCollect (collectId) {
        const query = {
            collectId
        }
        return axios({
            url: '/mall/good/Collect/deleteCollect',
            method: 'POST',
            params: query,
        });
    }
}
